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 <cstdlib>
17
18
#include "gtk_wrapper.h"
19
26
#define DICTIONARY_PUSH(s, element) dictionary_push (s, (void *) element)
27
28
typedef
struct
DictionaryEntry
29
{
30
char
* key;
31
void
* val;
32
}
DictionaryEntry
;
33
34
typedef
struct
Dictionary
35
{
37
int
len
;
39
size_t
size
;
40
DictionaryEntry
* entry;
41
}
Dictionary
;
42
43
Dictionary
*
44
dictionary_new (
void
);
45
46
#define dictionary_find_simple(dict, key, type) \
47
((type *) dictionary_find (dict, key, NULL))
48
49
void
*
50
dictionary_find (
Dictionary
* dict,
const
char
* key,
void
* def);
51
52
#define dictionary_add(dict, key, val) _dictionary_add (dict, key, (void *) val)
53
54
void
55
_dictionary_add (
Dictionary
* dict,
const
char
* key,
void
* value);
56
57
void
58
dictionary_free (
Dictionary
* self);
59
64
#endif
DictionaryEntry
Definition
dictionary.h:29
Dictionary
Definition
dictionary.h:35
Dictionary::size
size_t size
Size of the array.
Definition
dictionary.h:39
Dictionary::len
int len
Number of valid elements in the array.
Definition
dictionary.h:37
utils
dictionary.h
Generated by
1.11.0