1.1 --- a/common.c Thu Mar 23 00:32:22 2023 +0100
1.2 +++ b/common.c Sun Jan 14 23:22:03 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Common routines.
1.6 *
1.7 - * Copyright (C) 2019, 2020, 2022 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2019, 2020, 2022, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -430,25 +430,24 @@
1.13 char *item_type_name(struct parameter *param, enum component_role component,
1.14 int writing)
1.15 {
1.16 - if (param->cls == FPAGE_ITEM)
1.17 - {
1.18 - /* Permit the specification of receive window flexpage items. */
1.19 + /* Permit the specification of receive window flexpage items or the
1.20 + expectation of a capability. */
1.21 +
1.22 + int receiving = specify_receive_item(param, component, writing);
1.23
1.24 - if (specify_receive_fpage(param, component, writing))
1.25 - return "receive_fpage";
1.26 - else
1.27 - return "fpage";
1.28 - }
1.29 + if (param->cls == FPAGE_ITEM)
1.30 + return receiving ? "receive_fpage" : "fpage";
1.31 else
1.32 - return "capability";
1.33 + return receiving ? "receive_capability" : "capability";
1.34 }
1.35
1.36 -/* Return whether the parameter involves a receive window flexpage. */
1.37 +/* Return whether the parameter involves a receive window flexpage or the
1.38 + expectation of a capability. */
1.39
1.40 -int specify_receive_fpage(struct parameter *param,
1.41 - enum component_role component, int writing)
1.42 +int specify_receive_item(struct parameter *param,
1.43 + enum component_role component, int writing)
1.44 {
1.45 - return (param->cls == FPAGE_ITEM) &&
1.46 + return (param->cls & ITEM_CLASS) &&
1.47 (component == CLIENT_ROLE) &&
1.48 !(param->specifier & IN_PARAMETER) &&
1.49 (param->specifier & OUT_PARAMETER) &&