Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
dictionary.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: © 2019 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 */
6
13#ifndef __UTILS_DICTIONARY_H__
14#define __UTILS_DICTIONARY_H__
15
16#include <stdlib.h>
17
18#include <gtk/gtk.h>
19
26#define DICTIONARY_PUSH(s, element) dictionary_push (s, (void *) element)
27
28typedef struct DictionaryEntry
29{
30 char * key;
31 void * val;
33
34typedef struct Dictionary
35{
37 int len;
39 size_t size;
40 DictionaryEntry * entry;
42
44dictionary_new (void);
45
46#define dictionary_find_simple(dict, key, type) \
47 ((type *) dictionary_find (dict, key, NULL))
48
49void *
50dictionary_find (Dictionary * dict, const char * key, void * def);
51
52#define dictionary_add(dict, key, val) _dictionary_add (dict, key, (void *) val)
53
54void
55_dictionary_add (Dictionary * dict, const char * key, void * value);
56
57void
58dictionary_free (Dictionary * self);
59
64#endif
size_t size
Size of the array.
Definition dictionary.h:39
int len
Number of valid elements in the array.
Definition dictionary.h:37