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

Function condattr

win/curses/cursstat.c:1375–1407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373}
1374
1375static int
1376condattr(long bm, unsigned long *bmarray)
1377{
1378 int i, attr = 0;
1379
1380 if (bm && bmarray) {
1381 for (i = HL_ATTCLR_BOLD; i < BL_ATTCLR_MAX; ++i) {
1382 if ((bmarray[i] & bm) != 0) {
1383 switch(i) {
1384 case HL_ATTCLR_BOLD:
1385 attr |= HL_BOLD;
1386 break;
1387 case HL_ATTCLR_DIM:
1388 attr |= HL_DIM;
1389 break;
1390 case HL_ATTCLR_ITALIC:
1391 attr |= HL_ITALIC;
1392 break;
1393 case HL_ATTCLR_ULINE:
1394 attr |= HL_ULINE;
1395 break;
1396 case HL_ATTCLR_BLINK:
1397 attr |= HL_BLINK;
1398 break;
1399 case HL_ATTCLR_INVERSE:
1400 attr |= HL_INVERSE;
1401 break;
1402 }
1403 }
1404 }
1405 }
1406 return attr;
1407}
1408/* convert tty attributes to curses attributes;
1409 despite similar names, the mask fields have different values */
1410static int

Callers 1

curs_stat_condsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected