vlc.vim 4.27 KB
Newer Older
1
2
3
4
5
" vlc specific stuff
au Syntax c call VlcSyntax()
au Syntax cpp call VlcSyntax()

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

  " Todo
  syn keyword cTodo	contained TODO FIXME XXX \todo \bug
114
115
endfun