paul@100 | 1 | /* |
paul@100 | 2 | * Generation of declaration elements such as parameters and members. |
paul@100 | 3 | * |
paul@186 | 4 | * Copyright (C) 2019, 2020 Paul Boddie <paul@boddie.org.uk> |
paul@100 | 5 | * |
paul@100 | 6 | * This program is free software; you can redistribute it and/or |
paul@100 | 7 | * modify it under the terms of the GNU General Public License as |
paul@100 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@100 | 9 | * the License, or (at your option) any later version. |
paul@100 | 10 | * |
paul@100 | 11 | * This program is distributed in the hope that it will be useful, |
paul@100 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@100 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@100 | 14 | * GNU General Public License for more details. |
paul@100 | 15 | * |
paul@100 | 16 | * You should have received a copy of the GNU General Public License |
paul@100 | 17 | * along with this program; if not, write to the Free Software |
paul@100 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@100 | 19 | * Boston, MA 02110-1301, USA |
paul@100 | 20 | */ |
paul@100 | 21 | |
paul@100 | 22 | #pragma once |
paul@100 | 23 | |
paul@100 | 24 | #include <stdio.h> |
paul@100 | 25 | #include "types.h" |
paul@100 | 26 | |
paul@110 | 27 | /* Signatures. */ |
paul@110 | 28 | |
paul@110 | 29 | void write_interface_signature(struct signature *sig, enum signature_role role, |
paul@186 | 30 | enum component_role component, |
paul@186 | 31 | enum function_role function, FILE *fp, |
paul@110 | 32 | struct interface *iface); |
paul@110 | 33 | |
paul@139 | 34 | void write_interface_unimplemented_method(struct signature *sig, |
paul@139 | 35 | enum specifier direction, FILE *fp); |
paul@139 | 36 | |
paul@117 | 37 | void write_initial_parameter(const char *name, FILE *fp); |
paul@117 | 38 | |
paul@117 | 39 | void write_signatures(struct signature *sig, enum signature_role role, FILE *fp, |
paul@117 | 40 | struct interface *iface, |
paul@113 | 41 | void (*write_signature)(struct signature *, |
paul@113 | 42 | enum signature_role role, |
paul@113 | 43 | FILE *, struct interface *)); |
paul@100 | 44 | /* Parameter lists. */ |
paul@100 | 45 | |
paul@125 | 46 | void write_parameters(struct parameter *param, FILE *fp, enum parameter_role role, |
paul@139 | 47 | enum function_role function, enum specifier direction, |
paul@129 | 48 | int continuing); |
paul@125 | 49 | |
paul@129 | 50 | void write_parameter(struct parameter *param, FILE *fp, enum parameter_role role, |
paul@129 | 51 | enum function_role function); |
paul@100 | 52 | |
paul@100 | 53 | /* Structure member and variable declaration/initialisation. */ |
paul@100 | 54 | |
paul@100 | 55 | void write_declarations(struct parameter *param, enum specifier direction, |
paul@100 | 56 | enum parameter_class cls, FILE *fp); |