forward-visitor.h 718 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Forwarding visitor
  3. *
  4. * Copyright Red Hat, Inc. 2021
  5. *
  6. * Author: Paolo Bonzini <pbonzini@redhat.com>
  7. *
  8. * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
  9. * See the COPYING.LIB file in the top-level directory.
  10. *
  11. */
  12. #ifndef FORWARD_VISITOR_H
  13. #define FORWARD_VISITOR_H
  14. #include "qapi/visitor.h"
  15. typedef struct ForwardFieldVisitor ForwardFieldVisitor;
  16. /*
  17. * The forwarding visitor only expects a single name, @from, to be passed for
  18. * toplevel fields. It is converted to @to and forwarded to the @target visitor.
  19. * Calls within a struct are forwarded without changing the name.
  20. */
  21. Visitor *visitor_forward_field(Visitor *target, const char *from, const char *to);
  22. #endif