summaryrefslogtreecommitdiffstats
path: root/include/block/qdict.h
blob: d8cb502d7db3d687eb4701804db0562f4ca05b66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Special QDict functions used by the block layer
 *
 * Copyright (c) 2013-2018 Red Hat, Inc.
 *
 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
 * See the COPYING.LIB file in the top-level directory.
 */

#ifndef BLOCK_QDICT_H
#define BLOCK_QDICT_H

#include "qapi/qmp/qdict.h"

void qdict_copy_default(QDict *dst, QDict *src, const char *key);
void qdict_set_default_str(QDict *dst, const char *key, const char *val);

void qdict_join(QDict *dest, QDict *src, bool overwrite);

void qdict_extract_subqdict(QDict *src, QDict **dst, const char *start);
void qdict_array_split(QDict *src, QList **dst);
int qdict_array_entries(QDict *src, const char *subqdict);
QObject *qdict_crumple(const QDict *src, Error **errp);
void qdict_flatten(QDict *qdict);

typedef struct QDictRenames {
    const char *from;
    const char *to;
} QDictRenames;
bool qdict_rename_keys(QDict *qdict, const QDictRenames *renames, Error **errp);

Visitor *qobject_input_visitor_new_flat_confused(QDict *qdict,
                                                 Error **errp);
#endif