MCPcopy Create free account
hub / github.com/NetHack/NetHack / s_atr2str

Function s_atr2str

win/tty/termcap.c:1339–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1337static char nulstr[] = "";
1338
1339static char *
1340s_atr2str(int n)
1341{
1342 switch (n) {
1343 case ATR_ITALIC:
1344 /* if italic isn't available, fall through to underline */
1345 if (ZH && *ZH)
1346 return ZH;
1347 FALLTHROUGH;
1348 /*FALLTHRU*/
1349 case ATR_BLINK:
1350 case ATR_ULINE:
1351 if (n == ATR_BLINK) {
1352 if (MB && *MB)
1353 return MB;
1354 } else { /* Underline */
1355 if (nh_US && *nh_US)
1356 return nh_US;
1357 }
1358 FALLTHROUGH;
1359 /*FALLTHRU*/
1360 case ATR_BOLD:
1361 if (MD && *MD)
1362 return MD;
1363 if (nh_HI && *nh_HI)
1364 return nh_HI;
1365 break;
1366 case ATR_INVERSE:
1367 if (MR && *MR)
1368 return MR;
1369 break;
1370 case ATR_DIM:
1371 if (MH && *MH)
1372 return MH;
1373 break;
1374 }
1375 return nulstr;
1376}
1377
1378static char *
1379e_atr2str(int n)

Callers 1

term_start_attrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected