1" vlc specific stuff
2au Syntax c call VlcSyntax()
3au Syntax cpp call VlcSyntax()
4
5function VlcSyntax()
6  " Look for a VideoLAN copyright in the first 15 lines
7  let line=1
8  let vlc=0
9  while(line<=15)
10    if match(getline(line), ".*Copyright.*VideoLAN.*") > -1
11      let vlc=1
12      break
13    endif
14    let line=line+1
15  endwhile
16  if vlc==0
17    return
18  endif
19  " true/false
20  syn keyword cConstant VLC_TRUE VLC_FALSE
21  " return values
22  syn keyword cConstant VLC_SUCCESS VLC_EGENERIC VLC_ENOMEM VLC_ETHREAD
23  syn keyword cConstant VLC_ESTATUS VLC_EEXIT VLC_EMODULE VLC_EOBJECT
24  syn keyword cConstant VLC_ENOOBJ VLC_ENOMOD VLC_VAR_ADDRESS
25  " custom types
26  syn keyword cType vlc_fixed_t mtime_t byte_t dctelem_t ssize_t off_t
27  syn keyword cType vlc_bool_t vlc_fourcc_t vlc_value_t
28  " Core custom structures
29  syn keyword cType vlc_t libvlc_t vlc_object_t vlc_error_t vlc_status_t
30  syn keyword cType variable_t date_t
31  syn keyword cType vlc_thread_t vlc_cond_t vlc_mutex_t vlc_list_t
32  " Objects, modules, configurations
33  syn keyword cType module_bank_t module_t module_config_t module_symbols_t
34  syn keyword cType module_cache_t config_category_t
35  " Playlist
36  syn keyword cType playlist_t playlist_item_t
37  syn keyword cType services_discovery_t services_discovery_sys_t
38  syn keyword cType item_info_t item_info_category_t
39  syn keyword cType sout_format_t playlist_export_t playlist_import_t
40  " Intf
41  syn keyword cType intf_thread_t intf_sys_t intf_console_t intf_msg_t
42  syn keyword cType interaction_t interaction_dialog_t user_widget_t
43  syn keyword cType msg_bank_t msg_subscription_t
44  " Input
45  syn keyword cType input_thread_t input_thread_sys_t input_item_t
46  syn keyword cType access_t access_sys_t stream_t stream_sys_t
47  syn keyword cType demux_t demux_sys_t es_out_t es_out_id_t
48  syn keyword cType es_out_sys_t  es_descriptor_t
49  syn keyword cType seekpoint_t info_t info_category_t
50  " Formats
51  syn keyword cType audio_format_t video_format_t subs_format_t
52  syn keyword cType es_format_t video_palette_t
53  " Aout
54  syn keyword cType audio_output_t aout_sys_t
55  syn keyword cType aout_fifo_t audio_sample_format_t
56  syn keyword cType aout_mixer_sys_t aout_filter_sys_t audio_volume_t
57  syn keyword cType aout_mixer_t aout_output_t audio_date_t
58  syn keyword cType aout_filter_t
59  " Vout
60  syn keyword cType vout_thread_t  vout_sys_t vout_synchro_t
61  syn keyword cType chroma_sys_t picture_t picture_sys_t picture_heap_t
62  syn keyword cType video_frame_format_t
63  " SPU
64  syn keyword cType spu_t subpicture_t
65  syn keyword cType subpicture_region_t text_style_t
66  " Images
67  syn keyword cType image_handler_t
68  " Sout
69  syn keyword cType sout_instance_t sout_cfg_t
70  syn keyword cType sout_input_t sout_packetizer_input_t
71  syn keyword cType sout_access_out_t sout_access_out_sys_t
72  syn keyword cType sout_mux_t sout_mux_sys_t
73  syn keyword cType sout_stream_t sout_stream_sys_t
74  " Sout - announce
75  syn keyword cType session_descriptor_t
76  syn keyword cType sap_address_t sap_handler_t sap_session_t
77  " Decoders
78  syn keyword cType decoder_t decoder_sys_t encoder_t encoder_sys_t
79  " Filters
80  syn keyword cType filter_t filter_sys_t
81  " Blocks
82  syn keyword cType block_t block_fifo_t
83  " Network
84  syn keyword cType network_socket_t vlc_acl_t
85  " HTTPD
86  syn keyword cType httpd_t httpd_host_t httpd_url_t httpd_client_t
87  syn keyword cType httpd_callback_sys_t httpd_message_t httpd_callback_t
88  syn keyword cType httpd_file_t httpd_file_sys_t httpd_file_callback_t
89  syn keyword cType httpd_handler_t httpd_handler_sys_t
90  syn keyword cType httpd_handler_callback_t
91  syn keyword cType httpd_redirect_t httpd_stream_t
92  " TLS
93  syn keyword cType tls_t tls_server_t tls_session_t
94  " XML
95  syn keyword cType xml_t xml_sys_t xml_reader_t xml_reader_sys_t
96  " VoD
97  syn keyword cType vod_t vod_sys_t vod_media_t
98  " OpenGL
99  syn keyword cType opengl_t opengl_sys_t
100  " VLM
101  syn keyword cType vlm_t vlm_message_t vlm_media_t vlm_schedule_t
102  " Misc
103  syn keyword cType md5_t vlc_meta_t vlc_callback_t iso639_lang_t
104
105  " misc macros
106  syn keyword cOperator VLC_OBJECT VLC_EXPORT VLC_COMMON_MEMBERS
107  " don't use these any more, please
108  syn keyword cError u8 s8 u16 s16 u32 s32 u64 s64
109  " don't put trailing spaces! DON'T USE TABS!!!
110  syn match cSpaceError display excludenl "\s\+$"
111  syn match cSpaceError display "\t"
112
113  " Todo
114  syn keyword cTodo	contained TODO FIXME XXX \todo \bug
115endfun
116
117