- * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/* cover various ports and variants of terminfo */
#define V_ALLCAPS 0 /* all capabilities (SVr4, XSI, ncurses) */
#define V_SVR1 1 /* SVR1, Ultrix */
/* cover various ports and variants of terminfo */
#define V_ALLCAPS 0 /* all capabilities (SVr4, XSI, ncurses) */
#define V_SVR1 1 /* SVR1, Ultrix */
for (pass = 0; pass < 2; ++pass) {
for (s = d = 0; src[s] != '\0'; ++s) {
if (src[s] == ' ') {
if (pass) {
_nc_STRCPY(&result[d], fill, need + 1 - d);
for (pass = 0; pass < 2; ++pass) {
for (s = d = 0; src[s] != '\0'; ++s) {
if (src[s] == ' ') {
if (pass) {
_nc_STRCPY(&result[d], fill, need + 1 - d);
fmt_complex(TERMTYPE2 *tterm, const char *capability, char *src, int level)
{
bool percent = FALSE;
fmt_complex(TERMTYPE2 *tterm, const char *capability, char *src, int level)
{
bool percent = FALSE;
strncpy_DYN(&tmpbuf, "%", (size_t) 1);
strncpy_DYN(&tmpbuf, src, (size_t) 1);
src++;
strncpy_DYN(&tmpbuf, "%", (size_t) 1);
strncpy_DYN(&tmpbuf, src, (size_t) 1);
src++;
if (!params && *src != '\0' && *src != '%') {
strncpy_DYN(&tmpbuf, "\n", (size_t) 1);
indent_DYN(&tmpbuf, level + 1);
if (!params && *src != '\0' && *src != '%') {
strncpy_DYN(&tmpbuf, "\n", (size_t) 1);
indent_DYN(&tmpbuf, level + 1);
i = StrIndirect(j);
name = ExtStrname(tterm, (int) i, str_names);
assert(strlen(name) < sizeof(buffer) - EXTRA_CAP);
i = StrIndirect(j);
name = ExtStrname(tterm, (int) i, str_names);
assert(strlen(name) < sizeof(buffer) - EXTRA_CAP);
char *s = srccap, *d = buffer;
int need = 3 + (int) strlen(name);
while ((*d = *s++) != 0) {
char *s = srccap, *d = buffer;
int need = 3 + (int) strlen(name);
while ((*d = *s++) != 0) {
_nc_SPRINTF(name, _nc_SLIMIT(sizeof(name)) "lf%d", n);
cap = find_string(tterm, name);
if (VALID_STRING(cap)
_nc_SPRINTF(name, _nc_SLIMIT(sizeof(name)) "lf%d", n);
cap = find_string(tterm, name);
if (VALID_STRING(cap)
_nc_SPRINTF(name, _nc_SLIMIT(sizeof(name)) "kf%d", n);
cap = find_string(tterm, name);
if (VALID_STRING(cap)
_nc_SPRINTF(name, _nc_SLIMIT(sizeof(name)) "kf%d", n);
cap = find_string(tterm, name);
if (VALID_STRING(cap)
if (_nc_write_object(tterm, bigbuf, &offset, sizeof(bigbuf)) == OK) {
char numbuf[80];
if (_nc_write_object(tterm, bigbuf, &offset, sizeof(bigbuf)) == OK) {
char numbuf[80];
memset(mapped, 0, sizeof(mapped));
for (n = 0; acs_chars[n] != 0; n++) {
source = UChar(acs_chars[n]);
memset(mapped, 0, sizeof(mapped));
for (n = 0; acs_chars[n] != 0; n++) {
source = UChar(acs_chars[n]);