]> git.sesse.net Git - vlc/blob - include/main.h
b1ae2416379ea3cfb7de039893e7b566b1d3db27
[vlc] / include / main.h
1 /*****************************************************************************
2  * main.h: access to all program variables
3  * (c)1999 VideoLAN
4  *****************************************************************************
5  * Declaration and extern access to global program object.
6  *****************************************************************************/
7
8 /*****************************************************************************
9  * main_t, p_main (global variable)
10  *****************************************************************************
11  * This structure has an unique instance, declared in main and pointed by the
12  * only global variable of the program. It should allow access to any variable
13  * of the program, for user-interface purposes or more easier call of interface
14  * and common functions (example: the intf_*Msg functions). Please avoid using
15  * it when you can access the members you need in an other way. In fact, it
16  * should only be used by interface thread.
17  *****************************************************************************/
18 typedef struct
19 {
20     /* Global properties */
21     int                    i_argc;           /* command line arguments count */
22     char **                ppsz_argv;              /* command line arguments */
23     char **                ppsz_env;                /* environment variables */
24
25     /* Generic settings */
26     boolean_t              b_audio;             /* is audio output allowed ? */
27     boolean_t              b_video;             /* is video output allowed ? */
28     boolean_t              b_vlans;                 /* are vlans supported ? */
29
30     /* Unique threads */
31     p_aout_thread_t        p_aout;                    /* audio output thread */
32     p_intf_thread_t        p_intf;                  /* main interface thread */
33
34     /* Shared data - these structures are accessed directly from p_main by
35      * several modules */
36     p_intf_msg_t           p_msg;                 /* messages interface data */
37     p_input_vlan_t         p_vlan;                      /* vlan library data */
38 } main_t;
39
40 extern main_t *p_main;
41
42 /*****************************************************************************
43  * Prototypes - these methods are used to get default values for some threads
44  * and modules.
45  *****************************************************************************/
46 int    main_GetIntVariable( char *psz_name, int i_default );
47 char * main_GetPszVariable( char *psz_name, char *psz_default );
48 void   main_PutIntVariable( char *psz_name, int i_value );
49 void   main_PutPszVariable( char *psz_name, char *psz_value );