/* Copyright (C) 2021-2026 Free Software Foundation, Inc. Contributed by Oracle. This file is part of GNU Binutils. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdio.h>#include <string.h>#include <stdlib.h>#include <locale.h>#include <values.h>#include <assert.h> #include "libiberty.h"#include "comp_com.h" /* * To add a new message _FORMAT_ please perform the following tasks: * 1) Insert it into the list below, with the matching comment. * The table is sorted by parameter type. In increasing order * they are: String, Procedure, Variable, Loop, Region, Integer. * 2) Insert the corresponding information into the following * procedures in this file: ccm_num_params(), ccm_paramlist_index(), * ccm_param_primtype(), and ccm_param_hightype(). * 3) If you are also creating a new high-type or primitive-type, * extend the corresponding enum, update this comment and make sure * to update any code in the analyzer, iropt, cg or ube that depends * on knowing the limited set of types. */ typedef enum ccm_fmt { CCMFMT_NONE, /* none */ CCMFMT_S1, /* s1 */ CCMFMT_S1S2, /* s1, s2 */ CCMFMT_S1L2, /* s1, l2 */ CCMFMT_S1L2VV3, /* s1, l2, v3, v4, ... */ CCMFMT_S1R2VV3, /* s1, r2, v3, v4, ... */ CCMFMT_S1X2, /* s1, x2 */ CCMFMT_P1, /* p1 */ CCMFMT_P1S2, /* p1, s2 */ CCMFMT_P1S2P3, /* p1, s2, p3 */ CCMFMT_P1S2P3I4, /* p1, s2, p3, i4 */ CCMFMT_P1S2I3, /* p1, s2, i3 */ CCMFMT_P1P2, /* p1, p2 */ CCMFMT_P1L2, /* p1, l2 */ CCMFMT_P1I2, /* p1, i2 */ CCMFMT_P1I2L3, /* p1, i2, l3 */ CCMFMT_P1I2LL3, /* p1, i2, l3, l4 ... */ CCMFMT_P1I2I3, /* p1, i2, i3 */ CCMFMT_PP1, /* p1, p2, ... */ CCMFMT_V1, /* v1 */ CCMFMT_V1V2, /* v1, v2 */ CCMFMT_V1L2, /* v1, l2 */ CCMFMT_VV1, /* v1, v2, ... */ CCMFMT_L1, /* l1 */ CCMFMT_L1S2, /* l1, s2 */ CCMFMT_L1S2L3, /* l1, s2, l3 */ CCMFMT_L1P2, /* l1, p2 */ CCMFMT_L1P2I3, /* l1, p2, i3 */ CCMFMT_L1PP2, /* l1, p2, p3, ... */ CCMFMT_L1VV2, /* l1, v2, v3, ... */ CCMFMT_L1L2, /* l1, l2 */ CCMFMT_L1L2L3, /* l1, l2, l3 */ CCMFMT_LL1, /* l1, l2, ... */ CCMFMT_L1R2, /* l1, r2 */ CCMFMT_L1I2, /* l1, i2 */ CCMFMT_L1I2L3, /* l1, i2, l3 */ CCMFMT_L1I2LL3, /* l1, i2, l3, l4, ... */ CCMFMT_L1I2I3L4, /* l1, i2, i3, l4 */ CCMFMT_L1I2I3I4I5, /* l1, i2, ..., i5 */ CCMFMT_L1I2I3I4I5I6I7, /* l1, i2, ..., i7 */ CCMFMT_L1I2I3I4I5I6I7I8I9, /* l1, i2, ..., i9 */ CCMFMT_L1II2, /* l1, i2, i3, ... */ CCMFMT_R1, /* r1 */ CCMFMT_R1VV2, /* r1, v2, v3, ... */ CCMFMT_I1, /* i1 */ CCMFMT_I1P2I3, /* i1, p2, i3 */ CCMFMT_I1V2, /* i1, v2 */ CCMFMT_I1V2V3, /* i1, v2, v3 */ CCMFMT_I1L2, /* i1, l2 */ CCMFMT_I1LL2, /* i1, l2, l3, ... */ CCMFMT_I1I2I3I4, /* i1, i2, i3, i4 */ CCMFMT_I1I2I3I4I5I6, /* i1, i2, ..., i6 */ CCMFMT_I1I2I3I4I5I6I7I8, /* i1, i2, ..., i8 */ CCMFMT_LAST} Ccm_Fmttype_t; /* * Low- and high-level types for commentary parameters. */ typedef enum ccm_primtype{ CCM_PRIMTYPE_NONE, CCM_PRIMTYPE_STRING, CCM_PRIMTYPE_INTEGER, CCM_PRIMTYPE_HEXSTRING} Ccm_Primtype_t; typedef enum ccm_hightype{ CCM_HITYPE_NONE, CCM_HITYPE_STRING, CCM_HITYPE_PROCEDURE, CCM_HITYPE_VARIABLE, CCM_HITYPE_LOOPTAG, CCM_HITYPE_REGIONTAG, CCM_HITYPE_HEXSTRING, CCM_HITYPE_INTEGER} Ccm_Hitype_t; typedef struct ccm_attrs{ char *msg; /* I18N msg string */ const char *name; /* Print name for this message ID */ int32_t vis; /* Visibility bits */ Ccm_Fmttype_t fmt; /* Format type */} Ccm_Attr_t; static Ccm_Attr_t *ccm_attrs; /* Table of per-msg attributes */static nl_catd ccm_catd = (nl_catd) - 1; /* messages id */ /* * map COMPMSG_ID to table indices */static intccm_vis_index (COMPMSG_ID m){ int32_t high = m >> 8; int32_t low = m & 0xFF; for (int i = 0; i < 24; i++, high >>= 1) if (high <= 1) return (i << 8) + low + 1; return 0;} /* * Return # parameters for this message; MAXINT for messages with * parameter lists. */static intccm_num_params (COMPMSG_ID m){ int vindex; int res; vindex = ccm_vis_index (m); switch (ccm_attrs[vindex].fmt) { case CCMFMT_NONE: res = 0; break; case CCMFMT_S1: case CCMFMT_P1: case CCMFMT_V1: case CCMFMT_L1: case CCMFMT_R1: case CCMFMT_I1: res = 1; break; case CCMFMT_S1S2: case CCMFMT_S1L2: case CCMFMT_S1X2: case CCMFMT_P1S2: case CCMFMT_P1P2: case CCMFMT_P1L2: case CCMFMT_P1I2: case CCMFMT_V1V2: case CCMFMT_V1L2: case CCMFMT_L1S2: case CCMFMT_L1P2: case CCMFMT_L1L2: case CCMFMT_L1R2: case CCMFMT_L1I2: case CCMFMT_I1V2: case CCMFMT_I1L2: res = 2; break; case CCMFMT_P1S2P3: case CCMFMT_P1S2I3: case CCMFMT_P1I2L3: case CCMFMT_P1I2I3: case CCMFMT_L1S2L3: case CCMFMT_L1P2I3: case CCMFMT_L1L2L3: case CCMFMT_L1I2L3: case CCMFMT_I1P2I3: case CCMFMT_I1V2V3: res = 3; break; case CCMFMT_P1S2P3I4: case CCMFMT_L1I2I3L4: case CCMFMT_I1I2I3I4: res = 4; break; case CCMFMT_L1I2I3I4I5: res = 5; break; case CCMFMT_I1I2I3I4I5I6: res = 6; break; case CCMFMT_L1I2I3I4I5I6I7: res = 7; break; case CCMFMT_I1I2I3I4I5I6I7I8: res = 8; break; case CCMFMT_L1I2I3I4I5I6I7I8I9: res = 9; break; case CCMFMT_S1L2VV3: case CCMFMT_S1R2VV3: case CCMFMT_PP1: case CCMFMT_P1I2LL3: case CCMFMT_VV1: case CCMFMT_L1PP2: case CCMFMT_L1VV2: case CCMFMT_LL1: case CCMFMT_L1I2LL3: case CCMFMT_L1II2: case CCMFMT_R1VV2: case CCMFMT_I1LL2: res = MAXINT; break; case CCMFMT_LAST: default: /* programming failure */ /* if(1) is hack to get around warning from C++ compiler */ if (1) assert (0); break; } return res;} static intccm_paramlist_index (COMPMSG_ID m){ int res; int vindex = ccm_vis_index (m); switch (ccm_attrs[vindex].fmt) { case CCMFMT_NONE: case CCMFMT_S1: case CCMFMT_S1S2: case CCMFMT_S1L2: case CCMFMT_S1X2: case CCMFMT_P1: case CCMFMT_P1S2: case CCMFMT_P1S2P3: case CCMFMT_P1S2P3I4: case CCMFMT_P1S2I3: case CCMFMT_P1P2: case CCMFMT_P1L2: case CCMFMT_P1I2: case CCMFMT_P1I2L3: case CCMFMT_P1I2I3: case CCMFMT_V1: case CCMFMT_V1V2: case CCMFMT_V1L2: case CCMFMT_L1: case CCMFMT_L1S2: case CCMFMT_L1S2L3: case CCMFMT_L1P2: case CCMFMT_L1P2I3: case CCMFMT_L1L2: case CCMFMT_L1L2L3: case CCMFMT_L1R2: case CCMFMT_L1I2: case CCMFMT_L1I2L3: case CCMFMT_L1I2I3L4: case CCMFMT_L1I2I3I4I5: case CCMFMT_L1I2I3I4I5I6I7: case CCMFMT_L1I2I3I4I5I6I7I8I9: case CCMFMT_R1: case CCMFMT_I1: case CCMFMT_I1P2I3: case CCMFMT_I1V2: case CCMFMT_I1V2V3: case CCMFMT_I1L2: case CCMFMT_I1I2I3I4: case CCMFMT_I1I2I3I4I5I6: case CCMFMT_I1I2I3I4I5I6I7I8: res = 0; break; case CCMFMT_PP1: case CCMFMT_VV1: case CCMFMT_LL1: res = 1; break; case CCMFMT_L1PP2: case CCMFMT_L1VV2: case CCMFMT_L1II2: case CCMFMT_R1VV2: case CCMFMT_I1LL2: res = 2; break; case CCMFMT_S1L2VV3: case CCMFMT_S1R2VV3: case CCMFMT_P1I2LL3: case CCMFMT_L1I2LL3: res = 3; break; case CCMFMT_LAST: default: /* programming failure */ /* if(1) is hack to get around warning from C++ compiler */ if (1) assert (0); break; } return res;} static Ccm_Primtype_tccm_param_primtype (COMPMSG_ID m, int param_idx){ int vindex; Ccm_Primtype_t res; if (param_idx <= 0 || param_idx > ccm_num_params (m)) return CCM_PRIMTYPE_NONE; res = CCM_PRIMTYPE_NONE; /* should always be updated */ vindex = ccm_vis_index (m); switch (ccm_attrs[vindex].fmt) { /* * Sort cases by: * 1) # parameters * 2) Strings before Integers * 3) Enum tags */ case CCMFMT_NONE: /* programming failure */ /* if(1) is hack to get around warning from C++ compiler */ if (1) assert (0); break; case CCMFMT_S1: case CCMFMT_P1: case CCMFMT_V1: case CCMFMT_L1: case CCMFMT_R1: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_I1: if (param_idx == 1) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_S1S2: case CCMFMT_S1L2: case CCMFMT_P1S2: case CCMFMT_P1P2: case CCMFMT_P1L2: case CCMFMT_V1V2: case CCMFMT_V1L2: case CCMFMT_L1S2: case CCMFMT_L1P2: case CCMFMT_L1L2: case CCMFMT_L1R2: if (param_idx == 1 || param_idx == 2) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_S1X2: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2) res = CCM_PRIMTYPE_HEXSTRING; break; case CCMFMT_P1I2: case CCMFMT_L1I2: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1V2: case CCMFMT_I1L2: if (param_idx == 1) res = CCM_PRIMTYPE_INTEGER; else if (param_idx == 2) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_P1S2P3: case CCMFMT_L1S2L3: case CCMFMT_L1L2L3: if (param_idx >= 1 && param_idx <= 3) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_P1S2I3: case CCMFMT_L1P2I3: if (param_idx == 1 || param_idx == 2) res = CCM_PRIMTYPE_STRING; else if (param_idx == 3) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_P1I2L3: case CCMFMT_L1I2L3: if (param_idx == 1 || param_idx == 3) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_P1I2I3: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2 || param_idx == 3) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1V2V3: if (param_idx == 1) res = CCM_PRIMTYPE_INTEGER; else if (param_idx == 2 || param_idx == 3) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_I1P2I3: if (param_idx == 1 || param_idx == 3) res = CCM_PRIMTYPE_INTEGER; else if (param_idx == 2) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_L1I2I3L4: if (param_idx == 1 || param_idx == 4) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2 || param_idx == 3) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_P1S2P3I4: if (param_idx >= 1 && param_idx <= 3) res = CCM_PRIMTYPE_STRING; else if (param_idx == 4) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1I2I3I4: if (param_idx >= 1 && param_idx <= 4) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_L1I2I3I4I5: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx >= 2 && param_idx <= 5) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1I2I3I4I5I6: if (param_idx >= 1 && param_idx <= 6) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_L1I2I3I4I5I6I7: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx >= 2 && param_idx <= 7) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1I2I3I4I5I6I7I8: if (param_idx >= 1 && param_idx <= 8) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_L1I2I3I4I5I6I7I8I9: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx >= 2 && param_idx <= 9) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_S1L2VV3: case CCMFMT_S1R2VV3: case CCMFMT_PP1: case CCMFMT_VV1: case CCMFMT_L1PP2: case CCMFMT_L1VV2: case CCMFMT_LL1: case CCMFMT_R1VV2: res = CCM_PRIMTYPE_STRING; break; case CCMFMT_P1I2LL3: case CCMFMT_L1I2LL3: if (param_idx == 2) res = CCM_PRIMTYPE_INTEGER; else res = CCM_PRIMTYPE_STRING; break; case CCMFMT_L1II2: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1LL2: if (param_idx == 1)Lines 1–500 of 3480. Load more
/* Copyright (C) 2021-2026 Free Software Foundation, Inc. Contributed by Oracle. This file is part of GNU Binutils. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <locale.h> #include <values.h> #include <assert.h> #include "libiberty.h" #include "comp_com.h" /* * To add a new message _FORMAT_ please perform the following tasks: * 1) Insert it into the list below, with the matching comment. * The table is sorted by parameter type. In increasing order * they are: String, Procedure, Variable, Loop, Region, Integer. * 2) Insert the corresponding information into the following * procedures in this file: ccm_num_params(), ccm_paramlist_index(), * ccm_param_primtype(), and ccm_param_hightype(). * 3) If you are also creating a new high-type or primitive-type, * extend the corresponding enum, update this comment and make sure * to update any code in the analyzer, iropt, cg or ube that depends * on knowing the limited set of types. */ typedef enum ccm_fmt { CCMFMT_NONE, /* none */ CCMFMT_S1, /* s1 */ CCMFMT_S1S2, /* s1, s2 */ CCMFMT_S1L2, /* s1, l2 */ CCMFMT_S1L2VV3, /* s1, l2, v3, v4, ... */ CCMFMT_S1R2VV3, /* s1, r2, v3, v4, ... */ CCMFMT_S1X2, /* s1, x2 */ CCMFMT_P1, /* p1 */ CCMFMT_P1S2, /* p1, s2 */ CCMFMT_P1S2P3, /* p1, s2, p3 */ CCMFMT_P1S2P3I4, /* p1, s2, p3, i4 */ CCMFMT_P1S2I3, /* p1, s2, i3 */ CCMFMT_P1P2, /* p1, p2 */ CCMFMT_P1L2, /* p1, l2 */ CCMFMT_P1I2, /* p1, i2 */ CCMFMT_P1I2L3, /* p1, i2, l3 */ CCMFMT_P1I2LL3, /* p1, i2, l3, l4 ... */ CCMFMT_P1I2I3, /* p1, i2, i3 */ CCMFMT_PP1, /* p1, p2, ... */ CCMFMT_V1, /* v1 */ CCMFMT_V1V2, /* v1, v2 */ CCMFMT_V1L2, /* v1, l2 */ CCMFMT_VV1, /* v1, v2, ... */ CCMFMT_L1, /* l1 */ CCMFMT_L1S2, /* l1, s2 */ CCMFMT_L1S2L3, /* l1, s2, l3 */ CCMFMT_L1P2, /* l1, p2 */ CCMFMT_L1P2I3, /* l1, p2, i3 */ CCMFMT_L1PP2, /* l1, p2, p3, ... */ CCMFMT_L1VV2, /* l1, v2, v3, ... */ CCMFMT_L1L2, /* l1, l2 */ CCMFMT_L1L2L3, /* l1, l2, l3 */ CCMFMT_LL1, /* l1, l2, ... */ CCMFMT_L1R2, /* l1, r2 */ CCMFMT_L1I2, /* l1, i2 */ CCMFMT_L1I2L3, /* l1, i2, l3 */ CCMFMT_L1I2LL3, /* l1, i2, l3, l4, ... */ CCMFMT_L1I2I3L4, /* l1, i2, i3, l4 */ CCMFMT_L1I2I3I4I5, /* l1, i2, ..., i5 */ CCMFMT_L1I2I3I4I5I6I7, /* l1, i2, ..., i7 */ CCMFMT_L1I2I3I4I5I6I7I8I9, /* l1, i2, ..., i9 */ CCMFMT_L1II2, /* l1, i2, i3, ... */ CCMFMT_R1, /* r1 */ CCMFMT_R1VV2, /* r1, v2, v3, ... */ CCMFMT_I1, /* i1 */ CCMFMT_I1P2I3, /* i1, p2, i3 */ CCMFMT_I1V2, /* i1, v2 */ CCMFMT_I1V2V3, /* i1, v2, v3 */ CCMFMT_I1L2, /* i1, l2 */ CCMFMT_I1LL2, /* i1, l2, l3, ... */ CCMFMT_I1I2I3I4, /* i1, i2, i3, i4 */ CCMFMT_I1I2I3I4I5I6, /* i1, i2, ..., i6 */ CCMFMT_I1I2I3I4I5I6I7I8, /* i1, i2, ..., i8 */ CCMFMT_LAST } Ccm_Fmttype_t; /* * Low- and high-level types for commentary parameters. */ typedef enum ccm_primtype { CCM_PRIMTYPE_NONE, CCM_PRIMTYPE_STRING, CCM_PRIMTYPE_INTEGER, CCM_PRIMTYPE_HEXSTRING } Ccm_Primtype_t; typedef enum ccm_hightype { CCM_HITYPE_NONE, CCM_HITYPE_STRING, CCM_HITYPE_PROCEDURE, CCM_HITYPE_VARIABLE, CCM_HITYPE_LOOPTAG, CCM_HITYPE_REGIONTAG, CCM_HITYPE_HEXSTRING, CCM_HITYPE_INTEGER } Ccm_Hitype_t; typedef struct ccm_attrs { char *msg; /* I18N msg string */ const char *name; /* Print name for this message ID */ int32_t vis; /* Visibility bits */ Ccm_Fmttype_t fmt; /* Format type */ } Ccm_Attr_t; static Ccm_Attr_t *ccm_attrs; /* Table of per-msg attributes */ static nl_catd ccm_catd = (nl_catd) - 1; /* messages id */ /* * map COMPMSG_ID to table indices */ static int ccm_vis_index (COMPMSG_ID m) { int32_t high = m >> 8; int32_t low = m & 0xFF; for (int i = 0; i < 24; i++, high >>= 1) if (high <= 1) return (i << 8) + low + 1; return 0; } /* * Return # parameters for this message; MAXINT for messages with * parameter lists. */ static int ccm_num_params (COMPMSG_ID m) { int vindex; int res; vindex = ccm_vis_index (m); switch (ccm_attrs[vindex].fmt) { case CCMFMT_NONE: res = 0; break; case CCMFMT_S1: case CCMFMT_P1: case CCMFMT_V1: case CCMFMT_L1: case CCMFMT_R1: case CCMFMT_I1: res = 1; break; case CCMFMT_S1S2: case CCMFMT_S1L2: case CCMFMT_S1X2: case CCMFMT_P1S2: case CCMFMT_P1P2: case CCMFMT_P1L2: case CCMFMT_P1I2: case CCMFMT_V1V2: case CCMFMT_V1L2: case CCMFMT_L1S2: case CCMFMT_L1P2: case CCMFMT_L1L2: case CCMFMT_L1R2: case CCMFMT_L1I2: case CCMFMT_I1V2: case CCMFMT_I1L2: res = 2; break; case CCMFMT_P1S2P3: case CCMFMT_P1S2I3: case CCMFMT_P1I2L3: case CCMFMT_P1I2I3: case CCMFMT_L1S2L3: case CCMFMT_L1P2I3: case CCMFMT_L1L2L3: case CCMFMT_L1I2L3: case CCMFMT_I1P2I3: case CCMFMT_I1V2V3: res = 3; break; case CCMFMT_P1S2P3I4: case CCMFMT_L1I2I3L4: case CCMFMT_I1I2I3I4: res = 4; break; case CCMFMT_L1I2I3I4I5: res = 5; break; case CCMFMT_I1I2I3I4I5I6: res = 6; break; case CCMFMT_L1I2I3I4I5I6I7: res = 7; break; case CCMFMT_I1I2I3I4I5I6I7I8: res = 8; break; case CCMFMT_L1I2I3I4I5I6I7I8I9: res = 9; break; case CCMFMT_S1L2VV3: case CCMFMT_S1R2VV3: case CCMFMT_PP1: case CCMFMT_P1I2LL3: case CCMFMT_VV1: case CCMFMT_L1PP2: case CCMFMT_L1VV2: case CCMFMT_LL1: case CCMFMT_L1I2LL3: case CCMFMT_L1II2: case CCMFMT_R1VV2: case CCMFMT_I1LL2: res = MAXINT; break; case CCMFMT_LAST: default: /* programming failure */ /* if(1) is hack to get around warning from C++ compiler */ if (1) assert (0); break; } return res; } static int ccm_paramlist_index (COMPMSG_ID m) { int res; int vindex = ccm_vis_index (m); switch (ccm_attrs[vindex].fmt) { case CCMFMT_NONE: case CCMFMT_S1: case CCMFMT_S1S2: case CCMFMT_S1L2: case CCMFMT_S1X2: case CCMFMT_P1: case CCMFMT_P1S2: case CCMFMT_P1S2P3: case CCMFMT_P1S2P3I4: case CCMFMT_P1S2I3: case CCMFMT_P1P2: case CCMFMT_P1L2: case CCMFMT_P1I2: case CCMFMT_P1I2L3: case CCMFMT_P1I2I3: case CCMFMT_V1: case CCMFMT_V1V2: case CCMFMT_V1L2: case CCMFMT_L1: case CCMFMT_L1S2: case CCMFMT_L1S2L3: case CCMFMT_L1P2: case CCMFMT_L1P2I3: case CCMFMT_L1L2: case CCMFMT_L1L2L3: case CCMFMT_L1R2: case CCMFMT_L1I2: case CCMFMT_L1I2L3: case CCMFMT_L1I2I3L4: case CCMFMT_L1I2I3I4I5: case CCMFMT_L1I2I3I4I5I6I7: case CCMFMT_L1I2I3I4I5I6I7I8I9: case CCMFMT_R1: case CCMFMT_I1: case CCMFMT_I1P2I3: case CCMFMT_I1V2: case CCMFMT_I1V2V3: case CCMFMT_I1L2: case CCMFMT_I1I2I3I4: case CCMFMT_I1I2I3I4I5I6: case CCMFMT_I1I2I3I4I5I6I7I8: res = 0; break; case CCMFMT_PP1: case CCMFMT_VV1: case CCMFMT_LL1: res = 1; break; case CCMFMT_L1PP2: case CCMFMT_L1VV2: case CCMFMT_L1II2: case CCMFMT_R1VV2: case CCMFMT_I1LL2: res = 2; break; case CCMFMT_S1L2VV3: case CCMFMT_S1R2VV3: case CCMFMT_P1I2LL3: case CCMFMT_L1I2LL3: res = 3; break; case CCMFMT_LAST: default: /* programming failure */ /* if(1) is hack to get around warning from C++ compiler */ if (1) assert (0); break; } return res; } static Ccm_Primtype_t ccm_param_primtype (COMPMSG_ID m, int param_idx) { int vindex; Ccm_Primtype_t res; if (param_idx <= 0 || param_idx > ccm_num_params (m)) return CCM_PRIMTYPE_NONE; res = CCM_PRIMTYPE_NONE; /* should always be updated */ vindex = ccm_vis_index (m); switch (ccm_attrs[vindex].fmt) { /* * Sort cases by: * 1) # parameters * 2) Strings before Integers * 3) Enum tags */ case CCMFMT_NONE: /* programming failure */ /* if(1) is hack to get around warning from C++ compiler */ if (1) assert (0); break; case CCMFMT_S1: case CCMFMT_P1: case CCMFMT_V1: case CCMFMT_L1: case CCMFMT_R1: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_I1: if (param_idx == 1) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_S1S2: case CCMFMT_S1L2: case CCMFMT_P1S2: case CCMFMT_P1P2: case CCMFMT_P1L2: case CCMFMT_V1V2: case CCMFMT_V1L2: case CCMFMT_L1S2: case CCMFMT_L1P2: case CCMFMT_L1L2: case CCMFMT_L1R2: if (param_idx == 1 || param_idx == 2) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_S1X2: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2) res = CCM_PRIMTYPE_HEXSTRING; break; case CCMFMT_P1I2: case CCMFMT_L1I2: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1V2: case CCMFMT_I1L2: if (param_idx == 1) res = CCM_PRIMTYPE_INTEGER; else if (param_idx == 2) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_P1S2P3: case CCMFMT_L1S2L3: case CCMFMT_L1L2L3: if (param_idx >= 1 && param_idx <= 3) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_P1S2I3: case CCMFMT_L1P2I3: if (param_idx == 1 || param_idx == 2) res = CCM_PRIMTYPE_STRING; else if (param_idx == 3) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_P1I2L3: case CCMFMT_L1I2L3: if (param_idx == 1 || param_idx == 3) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_P1I2I3: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2 || param_idx == 3) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1V2V3: if (param_idx == 1) res = CCM_PRIMTYPE_INTEGER; else if (param_idx == 2 || param_idx == 3) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_I1P2I3: if (param_idx == 1 || param_idx == 3) res = CCM_PRIMTYPE_INTEGER; else if (param_idx == 2) res = CCM_PRIMTYPE_STRING; break; case CCMFMT_L1I2I3L4: if (param_idx == 1 || param_idx == 4) res = CCM_PRIMTYPE_STRING; else if (param_idx == 2 || param_idx == 3) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_P1S2P3I4: if (param_idx >= 1 && param_idx <= 3) res = CCM_PRIMTYPE_STRING; else if (param_idx == 4) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1I2I3I4: if (param_idx >= 1 && param_idx <= 4) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_L1I2I3I4I5: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx >= 2 && param_idx <= 5) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1I2I3I4I5I6: if (param_idx >= 1 && param_idx <= 6) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_L1I2I3I4I5I6I7: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx >= 2 && param_idx <= 7) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1I2I3I4I5I6I7I8: if (param_idx >= 1 && param_idx <= 8) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_L1I2I3I4I5I6I7I8I9: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else if (param_idx >= 2 && param_idx <= 9) res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_S1L2VV3: case CCMFMT_S1R2VV3: case CCMFMT_PP1: case CCMFMT_VV1: case CCMFMT_L1PP2: case CCMFMT_L1VV2: case CCMFMT_LL1: case CCMFMT_R1VV2: res = CCM_PRIMTYPE_STRING; break; case CCMFMT_P1I2LL3: case CCMFMT_L1I2LL3: if (param_idx == 2) res = CCM_PRIMTYPE_INTEGER; else res = CCM_PRIMTYPE_STRING; break; case CCMFMT_L1II2: if (param_idx == 1) res = CCM_PRIMTYPE_STRING; else res = CCM_PRIMTYPE_INTEGER; break; case CCMFMT_I1LL2: if (param_idx == 1)