|
VLC
4.0.0-dev
|
This file defines functions, structures and macros for handling arrays in vlc. More...

Go to the source code of this file.
Data Structures | |
| struct | vlc_array_t |
| struct | vlc_dictionary_entry_t |
| struct | vlc_dictionary_t |
Macros | |
| #define | TAB_INIT(count, tab) |
| #define | TAB_CLEAN(count, tab) |
| #define | TAB_APPEND_CAST(cast, count, tab, p) |
| #define | TAB_APPEND(count, tab, p) TAB_APPEND_CAST( , count, tab, p ) |
| #define | TAB_FIND(count, tab, p, idx) |
| #define | TAB_ERASE(count, tab, index) |
| #define | TAB_REMOVE(count, tab, p) |
| #define | TAB_INSERT_CAST(cast, count, tab, p, index) |
| #define | TAB_INSERT(count, tab, p, index) TAB_INSERT_CAST( , count, tab, p, index ) |
| #define | BSEARCH(entries, count, elem, zetype, key, answer) |
| Binary search in a sorted array. More... | |
| #define | _ARRAY_ALLOC(array, newsize) |
| #define | _ARRAY_GROW1(array) |
| #define | ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| #define | DECL_ARRAY(type) |
| #define | TYPEDEF_ARRAY(type, name) typedef DECL_ARRAY(type) name; |
| #define | ARRAY_INIT(array) |
| #define | ARRAY_RESET(array) |
| #define | ARRAY_APPEND(array, elem) |
| #define | ARRAY_INSERT(array, elem, pos) |
| #define | _ARRAY_SHRINK(array) |
| #define | ARRAY_FIND(array, p, idx) TAB_FIND((array).i_size, (array).p_elems, p, idx) |
| #define | ARRAY_REMOVE(array, pos) |
| #define | ARRAY_VAL(array, pos) array.p_elems[pos] |
| #define | ARRAY_BSEARCH(array, elem, zetype, key, answer) BSEARCH( (array).p_elems, (array).i_size, elem, zetype, key, answer) |
| #define | ARRAY_FOREACH(item, array) |
| #define | vlc_array_item_at_index(ar, idx) |
Typedefs | |
| typedef struct vlc_array_t | vlc_array_t |
| typedef struct vlc_dictionary_entry_t | vlc_dictionary_entry_t |
| typedef struct vlc_dictionary_t | vlc_dictionary_t |
Functions | |
| static void * | realloc_down (void *ptr, size_t size) |
| static void * | realloc_or_free (void *p, size_t sz) |
| This wrapper around realloc() will free the input pointer when realloc() returns NULL. More... | |
| static void | vlc_array_init (vlc_array_t *p_array) |
| static void | vlc_array_clear (vlc_array_t *p_array) |
| static size_t | vlc_array_count (vlc_array_t *p_array) |
| static ssize_t | vlc_array_index_of_item (const vlc_array_t *ar, const void *elem) |
| static int | vlc_array_insert (vlc_array_t *ar, void *elem, int idx) |
| static void | vlc_array_insert_or_abort (vlc_array_t *ar, void *elem, int idx) |
| static int | vlc_array_append (vlc_array_t *ar, void *elem) |
| static void | vlc_array_append_or_abort (vlc_array_t *ar, void *elem) |
| static void | vlc_array_remove (vlc_array_t *ar, size_t idx) |
| static uint64_t | DictHash (const char *psz_string, int hashsize) |
| static void | vlc_dictionary_init (vlc_dictionary_t *p_dict, int i_size) |
| static void | vlc_dictionary_clear (vlc_dictionary_t *p_dict, void(*pf_free)(void *p_data, void *p_obj), void *p_obj) |
| static int | vlc_dictionary_has_key (const vlc_dictionary_t *p_dict, const char *psz_key) |
| static void * | vlc_dictionary_value_for_key (const vlc_dictionary_t *p_dict, const char *psz_key) |
| static int | vlc_dictionary_keys_count (const vlc_dictionary_t *p_dict) |
| static bool | vlc_dictionary_is_empty (const vlc_dictionary_t *p_dict) |
| static char ** | vlc_dictionary_all_keys (const vlc_dictionary_t *p_dict) |
| static void | vlc_dictionary_insert_impl_ (vlc_dictionary_t *p_dict, const char *psz_key, void *p_value, bool rebuild) |
| static void | vlc_dictionary_insert (vlc_dictionary_t *p_dict, const char *psz_key, void *p_value) |
| static void | vlc_dictionary_remove_value_for_key (const vlc_dictionary_t *p_dict, const char *psz_key, void(*pf_free)(void *p_data, void *p_obj), void *p_obj) |
Variables | |
| static void *const | kVLCDictionaryNotFound = NULL |
This file defines functions, structures and macros for handling arrays in vlc.
| #define _ARRAY_ALLOC | ( | array, | |
| newsize | |||
| ) |
| #define _ARRAY_GROW1 | ( | array | ) |
| #define _ARRAY_SHRINK | ( | array | ) |
| #define ARRAY_APPEND | ( | array, | |
| elem | |||
| ) |
Referenced by addons_manager_Gather(), InstallEntry(), MergeSources(), TwalkGetNames(), var_GetAllNames(), vlc_event_attach(), and vout_control_Push().
| #define ARRAY_BSEARCH | ( | array, | |
| elem, | |||
| zetype, | |||
| key, | |||
| answer | |||
| ) | BSEARCH( (array).p_elems, (array).i_size, elem, zetype, key, answer) |
| #define ARRAY_FOREACH | ( | item, | |
| array | |||
| ) |
Referenced by addon_entry_Release(), addons_manager_Delete(), getHeldEntryByUUID(), vlc_event_manager_fini(), and vlc_event_send().
| #define ARRAY_INIT | ( | array | ) |
Referenced by addon_entry_New(), addons_manager_New(), FinderThread(), LoadLocalStorage(), var_GetAllNames(), vlc_event_manager_init(), and vout_control_Init().
| #define ARRAY_INSERT | ( | array, | |
| elem, | |||
| pos | |||
| ) |
| #define ARRAY_REMOVE | ( | array, | |
| pos | |||
| ) |
Referenced by FinderThread(), InstallerThread(), vlc_event_detach(), and vout_control_Pop().
| #define ARRAY_RESET | ( | array | ) |
Referenced by addon_entry_Release(), addons_manager_Delete(), FinderThread(), LoadLocalStorage(), vlc_event_manager_fini(), and vout_control_Clean().
| #define ARRAY_SIZE | ( | x | ) | (sizeof(x) / sizeof((x)[0])) |
Referenced by aout_OutputNew(), config_GetSysPath(), DeinterlaceIsModeValid(), demux_NameFromMimeType(), DemuxNameFromExtension(), EsOutUpdateInfo(), FilterOrder(), GuessType(), httpdLoop(), image_Type2Fourcc(), input_item_IsMaster(), input_item_slave_GetType(), InputGetExtraFiles(), libvlc_InternalActionsInit(), LookupAudio(), LookupSpu(), LookupVideo(), picture_Setup(), protocol_set_port(), SpuRenderSubpictures(), update_NeedUpgrade(), vlc_actions_get_id(), vlc_atomic_notify_all(), vlc_event_manager_fini(), vlc_event_manager_init(), vlc_global_mutex(), vlc_http_port_blocked(), vlc_keycode2str(), vlc_mkstemp(), vlc_player_ChangeRateOffset(), vlc_player_GetEsIdFromVout(), vlc_player_vout_AddCallbacks(), vlc_player_vout_DelCallbacks(), vlc_str2keycode(), vlc_threadvars_cleanup(), vlc_trace(), vlc_xml_decode(), vout_CreateVars(), vout_display_window_StateNotify(), and wait_bucket_get().
| #define ARRAY_VAL | ( | array, | |
| pos | |||
| ) | array.p_elems[pos] |
Referenced by vout_control_Clean(), and vout_control_Pop().
| #define BSEARCH | ( | entries, | |
| count, | |||
| elem, | |||
| zetype, | |||
| key, | |||
| answer | |||
| ) |
Binary search in a sorted array.
The key must be comparable by < and >
| entries | array of entries |
| count | number of entries |
| elem | key to check within an entry (like .id, or ->i_id) |
| zetype | type of the key |
| key | value of the key |
| answer | index of answer within the array. -1 if not found |
| #define DECL_ARRAY | ( | type | ) |
Referenced by TwalkGetNames(), and var_GetAllNames().
| #define TAB_APPEND | ( | count, | |
| tab, | |||
| p | |||
| ) | TAB_APPEND_CAST( , count, tab, p ) |
Referenced by Add(), GetVarSlaves(), InitPrograms(), input_item_AddOption(), input_item_AddSlave(), input_item_Copy(), input_item_MergeInfos(), input_item_node_AppendNode(), input_item_ReplaceInfos(), input_item_SetEpg(), input_item_UpdateTracksInfo(), input_resource_GetVoutDecoderDevice(), input_SlaveSourceAdd(), InputGetExtraFilesPattern(), InputItemVaAddInfo(), LanguageSplit(), LoadSlaves(), Manage(), rdh_unflatten(), sout_MuxAddStream(), subtitles_Detect(), var_Change(), vlc_epg_AddEvent(), vlc_epg_Duplicate(), vlc_readdir_helper_additem(), vlm_ControlMediaAdd(), vlm_ControlMediaGets(), vlm_ControlMediaInstanceGets(), and vlm_ControlMediaInstanceStart().
Referenced by vlm_media_Copy().
| #define TAB_CLEAN | ( | count, | |
| tab | |||
| ) |
Referenced by Destroy(), End(), input_item_Release(), InputSourceDestroy(), InputSourceInit(), LoadSlaves(), UpdateTitleListfromDemux(), var_Change(), vlc_epg_Clean(), vlc_readdir_helper_finish(), vlm_Delete(), and vlm_media_Clean().
| #define TAB_ERASE | ( | count, | |
| tab, | |||
| index | |||
| ) |
Referenced by input_item_DelInfo(), sout_MuxDeleteStream(), and var_Change().
Referenced by input_resource_GetVoutDecoderDevice(), input_resource_PutVoutLocked(), and sout_MuxDeleteStream().
| #define TAB_INIT | ( | count, | |
| tab | |||
| ) |
Referenced by Create(), InitPrograms(), input_EsOutTimeshiftNew(), input_item_NewExt(), InputGetExtraFiles(), InputGetExtraFilesPattern(), InputSourceInit(), LoadSlaves(), UpdateTitleListfromDemux(), vlc_epg_Init(), vlc_media_tree_New(), vlc_readdir_helper_init(), vlm_ControlMediaAdd(), vlm_ControlMediaGets(), vlm_ControlMediaInstanceGets(), vlm_media_Init(), and vlm_New().
| #define TAB_INSERT | ( | count, | |
| tab, | |||
| p, | |||
| index | |||
| ) | TAB_INSERT_CAST( , count, tab, p, index ) |
Referenced by vlc_epg_AddEvent().
Referenced by Del(), DestroyVout(), input_item_node_RemoveNode(), input_resource_PutVoutLocked(), Manage(), sout_MuxAddStream(), vlm_ControlMediaDel(), and vlm_MediaInstanceDelete().
| #define TYPEDEF_ARRAY | ( | type, | |
| name | |||
| ) | typedef DECL_ARRAY(type) name; |
| #define vlc_array_item_at_index | ( | ar, | |
| idx | |||
| ) |
Referenced by dialog_clear_all_locked(), fingerprint_request_Delete(), mrl_FragmentSplit(), sout_StreamChainNew(), stream_extractor_AttachParsed(), ThreadChangeFilters(), vlc_http_cookies_destroy(), vlc_http_cookies_fetch(), and vlc_http_cookies_store().
| typedef struct vlc_array_t vlc_array_t |
| typedef struct vlc_dictionary_entry_t vlc_dictionary_entry_t |
| typedef struct vlc_dictionary_t vlc_dictionary_t |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
This wrapper around realloc() will free the input pointer when realloc() returns NULL.
The use case ptr = realloc(ptr, newsize) will cause a memory leak when ptr pointed to a heap allocation before, leaving the buffer allocated but unreferenced. vlc_realloc() is a drop-in replacement for that use case (and only that use case).
Referenced by vlc_config_create(), and vlc_stream_ReadLine().
|
inlinestatic |
References vlc_array_t::i_count, vlc_array_t::pp_elems, and unlikely.
Referenced by dialog_add_locked(), mrl_FragmentSplit(), vlc_array_append_or_abort(), and vlc_http_cookies_store().
|
inlinestatic |
References vlc_array_append().
Referenced by sout_StreamChainNew(), and ThreadChangeFilters().
|
inlinestatic |
References vlc_array_t::pp_elems, and vlc_array_init().
Referenced by mrl_FragmentSplit(), sout_StreamChainNew(), stream_extractor_AttachParsed(), ThreadChangeFilters(), and vlc_http_cookies_destroy().
|
inlinestatic |
|
inlinestatic |
References vlc_array_t::i_count, and vlc_array_t::pp_elems.
Referenced by dialog_remove_locked().
|
inlinestatic |
References vlc_array_t::i_count, and vlc_array_t::pp_elems.
Referenced by fingerprint_request_New(), libvlc_InternalDialogInit(), mrl_FragmentSplit(), sout_StreamChainNew(), ThreadChangeFilters(), vlc_array_clear(), and vlc_http_cookies_new().
|
inlinestatic |
References vlc_array_t::i_count, vlc_array_t::pp_elems, and unlikely.
Referenced by vlc_array_insert_or_abort().
|
inlinestatic |
References vlc_array_insert().
|
inlinestatic |
References vlc_array_t::i_count, likely, and vlc_array_t::pp_elems.
Referenced by dialog_remove_locked(), and vlc_http_cookies_store().
|
inlinestatic |
References count, vlc_dictionary_t::i_size, vlc_dictionary_t::p_entries, vlc_dictionary_entry_t::p_next, vlc_dictionary_entry_t::psz_key, strdup(), unlikely, and vlc_dictionary_keys_count().
Referenced by vlc_meta_CopyExtraNames(), and vlc_meta_Merge().
|
inlinestatic |
|
inlinestatic |
References DictHash(), vlc_dictionary_t::i_size, vlc_dictionary_t::p_entries, vlc_dictionary_entry_t::p_next, and vlc_dictionary_entry_t::psz_key.
Referenced by AddAlbumCache().
|
inlinestatic |
References vlc_dictionary_t::i_size, and vlc_dictionary_t::p_entries.
Referenced by input_fetcher_New(), vlc_dictionary_insert_impl_(), and vlc_meta_New().
|
inlinestatic |
References vlc_dictionary_insert_impl_().
Referenced by AddAlbumCache(), vlc_meta_AddExtra(), and vlc_meta_Merge().
|
inlinestatic |
|
inlinestatic |
References vlc_dictionary_t::i_size, and vlc_dictionary_t::p_entries.
|
inlinestatic |
References count, vlc_dictionary_t::i_size, vlc_dictionary_t::p_entries, and vlc_dictionary_entry_t::p_next.
Referenced by vlc_dictionary_all_keys(), and vlc_meta_GetExtraCount().
|
inlinestatic |
References DictHash(), vlc_dictionary_t::i_size, vlc_dictionary_t::p_entries, vlc_dictionary_entry_t::p_next, vlc_dictionary_entry_t::p_value, and vlc_dictionary_entry_t::psz_key.
Referenced by vlc_meta_AddExtra(), and vlc_meta_Merge().
|
inlinestatic |
|
static |
Referenced by vlc_dictionary_value_for_key(), and vlc_meta_AddExtra().
1.8.13