aboutsummaryrefslogtreecommitdiffstats
path: root/include/qapi/forward-visitor.h
blob: 50fb3e9d50b5f7fa74eac3508cb4166218ab5747 (plain)
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
/*
 * Forwarding visitor
 *
 * Copyright Red Hat, Inc. 2021
 *
 * Author: Paolo Bonzini <pbonzini@redhat.com>
 *
 * 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 FORWARD_VISITOR_H
#define FORWARD_VISITOR_H

#include "qapi/visitor.h"

typedef struct ForwardFieldVisitor ForwardFieldVisitor;

/*
 * The forwarding visitor only expects a single name, @from, to be passed for
 * toplevel fields.  It is converted to @to and forwarded to the @target visitor.
 * Calls within a struct are forwarded without changing the name.
 */
Visitor *visitor_forward_field(Visitor *target, const char *from, const char *to);

#endif