+ if (number > NUM_PARM)
+ number = NUM_PARM;
+ return number;
+}
+
+static NCURSES_INLINE char *
+tparam_internal(int use_TPARM_ARG, const char *string, va_list ap)
+{
+ char *p_is_s[NUM_PARM];
+ TPARM_ARG param[NUM_PARM];
+ int popcount = 0;
+ int number;
+ int num_args;
+ int len;
+ int level;
+ int x, y;
+ int i;
+ const char *cp = string;
+ size_t len2;
+ bool termcap_hack;
+ bool incremented_two;
+
+ if (cp == NULL)
+ return NULL;
+
+ TPS(out_used) = 0;
+ len2 = strlen(cp);
+
+ /*
+ * Find the highest parameter-number referred to in the format string.
+ * Use this value to limit the number of arguments copied from the
+ * variable-length argument list.
+ */
+ number = _nc_tparm_analyze(cp, p_is_s, &popcount);
+ if (TPS(fmt_buff) == 0)
+ return NULL;
+
+ incremented_two = FALSE;
+
+ if (number > NUM_PARM)
+ number = NUM_PARM;
+ if (popcount > NUM_PARM)
+ popcount = NUM_PARM;
+ num_args = max(popcount, number);
+
+ for (i = 0; i < num_args; i++) {