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

Function hlattr2attrname

src/botl.c:3368–3401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3366}
3367
3368staticfn char *
3369hlattr2attrname(int attrib, char *buf, size_t bufsz)
3370{
3371 if (attrib && buf) {
3372 char attbuf[BUFSZ];
3373 int first = 0;
3374 size_t k;
3375
3376 attbuf[0] = '\0';
3377 if (attrib == HL_NONE) {
3378 Strcpy(buf, "normal");
3379 return buf;
3380 }
3381
3382 if (attrib & HL_BOLD)
3383 Strcat(attbuf, first++ ? "+bold" : "bold");
3384 if (attrib & HL_DIM)
3385 Strcat(attbuf, first++ ? "+dim" : "dim");
3386 if (attrib & HL_ITALIC)
3387 Strcat(attbuf, first++ ? "+italic" : "italic");
3388 if (attrib & HL_ULINE)
3389 Strcat(attbuf, first++ ? "+underline" : "underline");
3390 if (attrib & HL_BLINK)
3391 Strcat(attbuf, first++ ? "+blink" : "blink");
3392 if (attrib & HL_INVERSE)
3393 Strcat(attbuf, first++ ? "+inverse" : "inverse");
3394
3395 k = strlen(attbuf);
3396 if (k < (size_t)(bufsz - 1))
3397 Strcpy(buf, attbuf);
3398 return buf;
3399 }
3400 return (char *) 0;
3401}
3402
3403struct _status_hilite_line_str {
3404 int id;

Callers 3

status_hilite2strFunction · 0.85
status_hilite_menu_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected