| // Copyright 2021 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| package codegen |
| |
| const tmplDecoderEncoderSource = ` |
| {{- define "DecoderEncoderSource" -}} |
| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <{{ .PrimaryHeader }}> |
| |
| {{ range .Headers -}} |
| #include <{{ . }}/llcpp/fidl.h> |
| {{- end }} |
| |
| // For ::fidl::fuzzing::DecoderEncoder. |
| #include <lib/fidl/cpp/fuzzing/decoder_encoder.h> |
| // For ::std::pair. |
| #include <utility> |
| // For uint*_t. |
| #include <stdint.h> |
| // For ZX_ERR_INTERNAL. |
| #include <zircon/errors.h> |
| // For zx_handle_info_t and zx_status_t. |
| #include <zircon/types.h> |
| |
| ::std::vector<::fidl::fuzzing::DecoderEncoder> |
| ::fuzzing::{{ range .Library }}{{ . }}_{{ end }}decoder_encoders = { |
| {{ range .Decls }} |
| {{- if Eq .Kind Kinds.Protocol -}} |
| {{ $protocol := UnwrapProtocol . }}{{ template "ProtocolDecoderEncoders" $protocol }} |
| {{- end -}} |
| {{- if Eq .Kind Kinds.Struct }}{{ template "DecoderEncoder" . }},{{- end -}} |
| {{- if Eq .Kind Kinds.Table }}{{ template "DecoderEncoder" . }},{{- end -}} |
| {{- end }} |
| }; |
| {{- end }} |
| ` |