00001 /***************************************************************************** 00002 * vlc_objects.h: vlc_object_t definition and manipulation methods 00003 ***************************************************************************** 00004 * Copyright (C) 2002-2008 VLC authors and VideoLAN 00005 * $Id: 06ac2bbd9e02f5a481ddc868b909c933a046d877 $ 00006 * 00007 * Authors: Samuel Hocevar <sam@zoy.org> 00008 * 00009 * This program is free software; you can redistribute it and/or modify it 00010 * under the terms of the GNU Lesser General Public License as published by 00011 * the Free Software Foundation; either version 2.1 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public License 00020 * along with this program; if not, write to the Free Software Foundation, 00021 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00022 *****************************************************************************/ 00023 00024 /** 00025 * \file 00026 * This file defines the vlc_object_t structure and object types. 00027 */ 00028 00029 /** 00030 * \defgroup vlc_object Objects 00031 * @{ 00032 */ 00033 00034 /* Object flags */ 00035 #define OBJECT_FLAGS_QUIET 0x0002 00036 #define OBJECT_FLAGS_NOINTERACT 0x0004 00037 00038 /***************************************************************************** 00039 * The vlc_object_t type. Yes, it's that simple :-) 00040 *****************************************************************************/ 00041 /** The main vlc_object_t structure */ 00042 struct vlc_object_t 00043 { 00044 VLC_COMMON_MEMBERS 00045 }; 00046 00047 /***************************************************************************** 00048 * Prototypes 00049 *****************************************************************************/ 00050 VLC_API void *vlc_object_create( vlc_object_t *, size_t ) VLC_MALLOC VLC_USED; 00051 VLC_API vlc_object_t *vlc_object_find_name( vlc_object_t *, const char * ) VLC_USED VLC_DEPRECATED; 00052 VLC_API void * vlc_object_hold( vlc_object_t * ); 00053 VLC_API void vlc_object_release( vlc_object_t * ); 00054 VLC_API vlc_list_t *vlc_list_children( vlc_object_t * ) VLC_USED; 00055 VLC_API void vlc_list_release( vlc_list_t * ); 00056 VLC_API char *vlc_object_get_name( const vlc_object_t * ) VLC_USED; 00057 #define vlc_object_get_name(o) vlc_object_get_name(VLC_OBJECT(o)) 00058 00059 /**}@*/ 00060 00061 #define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b ) 00062 00063 #define vlc_object_find_name(a,b) \ 00064 vlc_object_find_name( VLC_OBJECT(a),b) 00065 00066 #define vlc_object_hold(a) \ 00067 vlc_object_hold( VLC_OBJECT(a) ) 00068 00069 #define vlc_object_release(a) \ 00070 vlc_object_release( VLC_OBJECT(a) ) 00071 00072 #define vlc_list_children(a) \ 00073 vlc_list_children( VLC_OBJECT(a) ) 00074 00075 /* Objects and threading */ 00076 VLC_API void vlc_object_kill( vlc_object_t * ) VLC_DEPRECATED; 00077 #define vlc_object_kill(a) \ 00078 vlc_object_kill( VLC_OBJECT(a) ) 00079 00080 VLC_USED VLC_DEPRECATED 00081 static inline bool vlc_object_alive (const vlc_object_t *obj) 00082 { 00083 barrier (); 00084 return !obj->b_die; 00085 } 00086 00087 #define vlc_object_alive(a) vlc_object_alive( VLC_OBJECT(a) ) 00088 00089 /** @} */
1.7.1